<template>
    <div class="settings-container container">
        <NavBar title="设置"></NavBar>

        <van-cell-group>
            <van-cell icon="" title="修改密码" is-link />
            <van-cell icon="" title="日志查询" is-link />
            <van-cell icon="" title="隐私" is-link />
            <van-cell icon="" title="关于" is-link />
            <van-cell icon="" title="用户服务协议" is-link />
        </van-cell-group>

        <van-button class="loginout-btn" block @click="loginout">退出登陆</van-button>
    </div>
</template>
<script>
import NavBar from '@/components/navbar';
import {Dialog} from 'vant';

export default {
    name: 'Settings',
    components:{
        NavBar
    },
    methods:{
        loginout() {
            Dialog.confirm({
                title: '确定退出登陆吗',
            })
            .then(() => {
                localStorage.removeItem('user');
                this.$push('/login');
            })
            .catch(() => {
                // on cancel
            });
        }
    }
}
</script>
<style lang="less">
    .loginout-btn {
        margin-top:60px;
    }
</style>